Skip to main content

Check Status of Adobe Agreement

Flow Overview

  • Name: Check Status of Adobe Agreement
  • Purpose: Check the status of all outstanding agreements within Adobe Sign
  • Date Created / Last Modified: Useful for tracking changes.

Dependencies

  • Dataverse
    • Document Approval
    • Contact
  • Adobe Sign

Trigger

  • Type: Schedule
    • Frequency : 15 Minute Interval
  • Parameters: N/A

List Document Approvals with Mixed Approval Statuses

  • Connector: Dataverse
  • Action Type: List Rows
    • Table Name: Document Approvals
    • Fetxh XML Query:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="tt_documentapproval">
<attribute name="tt_name" />
<attribute name="statuscode" />
<attribute name="tt_documentapprovalid" />
<attribute name="tt_agreementitems" />
<attribute name="tt_agreementids" />
<order attribute="tt_name" descending="false" />
<filter type="and">
<condition attribute="tt_agreementitems" operator="like" value="%&quot;Status&quot;:&quot;Pending Signing&quot;%" />
<condition attribute="tt_agreementitems" operator="like" value="%&quot;Status&quot;:&quot;Signed&quot;%" />
<condition attribute="modifiedon" operator="last-x-hours" value="1" />
</filter>
</entity>
</fetch>

Initialize AgreementItems

  • Action Type: Initialise Variable
    • Name: AgreementItems
    • Type: Array
    • Value: []

Initialize AllFilesSigned

  • Action Type: Initialise Variable
    • Name: AllFilesSigned
    • Type: Boolean
    • Value: @{true}

Initialize StatusReason

  • Action Type: Initialise Variable
    • Name: StatusReason
    • Type: Integer
    • Value:

Initialize Status

  • Action Type: Initialise Variable
    • Name: Status
    • Type: Integer
    • Value:

Apply to each Document Approval

  • Action Type: Apply to Each
    • Value: @{outputs('List_Document_Approvals_with_Mixed_Approval_Statuses')?['body/value']}

Clear AgreementItems

  • Action Type: Set Variable
    • Name: AgreementItems
    • Value: []

Set AllFilesSigned to True

  • Action Type: Set Variable
    • Name: AllFilesSigned
    • Value: @{true}

Get a Document Approval by ID

  • Connector: Dataverse
  • Action Type: Get a Row by ID
    • Table Name: Document Approvals
    • Row ID: @{items('Apply_to_each_Document_Approval')?['tt_documentapprovalid']}

Parse JSON of Agreement Items

  • Action Type: Parse JSON
    • Content: @{outputs('Get_a_Document_Approval_by_ID')?['body/tt_agreementitems']}
    • Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"DocumentName": {
"type": "string"
},
"DocumentURL": {
"type": "string"
},
"Status": {
"type": "string"
},
"AgreementID": {
"type": "string"
}
},
"required": [
"DocumentName",
"DocumentURL",
"Status",
"AgreementID"
]
}
}

Apply to each AgreementID

  • Action Type: Apply to Each
    • Value: @{body('Parse_JSON_of_Agreement_Items')}

Get the status of an agreement

  • Connector: Adobe Sign
  • Action Type: Get the status of an agreement
    • Agreement ID: @{items('Apply_to_each_AgreementID')['AgreementID']}

If PDF Is Signed

  • Action Type: Condition
    • Condition Type: AND
      • Condition: @{outputs('Get_the_status_of_an_agreement')?['body/status']} is equal to SIGNED

Compose Signed Item

  • Action Type: Compose
  • Inputs:
{
"DocumentName": "@{items('Apply_to_each_AgreementID')['DocumentName']}",
"DocumentURL": "@{items('Apply_to_each_AgreementID')['DocumentURL']}",
"Status": "Signed",
"AgreementID": "@{items('Apply_to_each_AgreementID')['AgreementID']}"
}

Append Signed Item to AgreementItems

  • Action Type: Append to array variable
  • Name: AgreementItems
  • Value: @{outputs('Compose_Signed_Item')}

Compose AgreementItems String

  • Action Type: Compose
    • Inputs: @{string(variables('AgreementItems'))}